-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI/CD Pipeline Construction #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ณ ์ํ์
จ์ต๋๋ค
์ ํ 1 ์ง๋ฌธ 2๋ก ๋ฆฌ๋ทฐ๋ฅผ ๋จ๊ธฐ๊ธฐ๋ ํ๋๋ฐ ํด๋น PR์ ๋ฌธ์ ๋ ์๋ ๊ฒ ๊ฐ์ Approve ํ์ต๋๋ค
์๊ฐ ๋์ค ๋ ๋ต๋ณ ๋ถํ๋๋ฆฝ๋๋ค
- name: Docker build & push to prod | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/spaced:0.0.1-SNAPSHOT . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ํ ๐
๊น๋จน์๊น๋ด ์ ํ์ผ๋ก ๋จ๊ฒผ๊ณ ์ ์ฉํ์ง ์์๋ ๊ด์ฐฎ์ต๋๋ค
๋์ปค ์ด๋ฏธ์ง ํ๊ทธ ๊ฐ์ ๋ถ๋ถ์ ๋์ค์ ๋ฆด๋ฆฌ์ฆ ๊ด๋ฆฌ๋ฅผ ํ๋ค๊ณ ํ๋ฉด ๋ณ๊ฒฝํด์ผ ํ ๊ฒ ๊ฐ๊ธฐ๋ ํฉ๋๋ค
๋ค๋ง ๋ฆด๋ฆฌ์ฆ ๊ด๋ฆฌ ์์ฒด์ ๋ํ ์ปจ๋ฒค์
์ ์ ์ ํ์ผ๋ ๊ทธ๋๋ก ์งํํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค, ํ์ฌ๋ ๊ฐ๋จํ ๋ฐฐํฌ๋ฅผ ์๋ํํ๋ ๋ฐ ์ด์ ์ ๋ง์ถ์์ต๋๋ค. ์ถํ ๋ฆด๋ฆฌ์ฆ ๊ด๋ฆฌ ์ปจ๋ฒค์ ์ ๋์ ํ ๋ ์ด๋ฏธ์ง ํ๊ทธ ๊ด๋ฆฌ๋ฅผ ํจ๊ป ๊ฐ์ ํ๋๋ก ํ๊ฒ ์ต๋๋ค.
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST_PROD }} | ||
username: ubuntu | ||
key: ${{ secrets.PRIVATE_KEY }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ง๋ฌธ ๐ฌ
Self Hosted Runner ๊ฐ์๊ฑธ ์ฌ์ฉํ ์๋ ์์ผ์ จ์ํ ๋ฐ , ssh-action์ ์ฌ์ฉํด AWS ํค๋ก ์ธ๋ถ์์ ์ ์ํด CD ๊ณผ์ ์ ์งํํ๋ ๋ฐฉ์์ ์ ํํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํฐ ์ด์ ๋ ์๊ณ AWS ํค๋ฅผ ์ฌ์ฉํ์ฌ ํน์ ์๋ฒ์๋ง ์ ๊ทผํ ์ ์๋๋ก ์ค์ ํ์ต๋๋ค.
script: | | ||
sudo docker stop spaced | ||
sudo docker rm spaced | ||
sudo docker rmi ${{ secrets.DOCKER_USERNAME }}/spaced:0.0.1-SNAPSHOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ง๋ฌธ ๐ฌ
pull ์ ์ ์ด๋ฏธ์ง๋ฅผ ์ญ์ ํ๋๊น ๊ด์ฐฎ์ ๊ฒ ๊ฐ๊ธฐ๋ ํ๋ฐ...ํน์ ๋ชฐ๋ผ์ ๋๊ธ๋ง ์ด๋ฏธ์ง๋ฅผ ์ ๊ฒฝ ์ฐ์ง ์์๋ ๊ด์ฐฎ์์ง ์ง๋ฌธ ๋๋ฆฝ๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ ์ค์ ์์๋ ์ด๋ฏธ์ง๋ฅผ pullํ๊ธฐ ์ ์ ๊ธฐ์กด ์ด๋ฏธ์ง๋ฅผ ์ญ์ ํ๊ณ ์์ด ๋๊ธ๋ง ์ด๋ฏธ์ง๊ฐ ๋จ์ง ์๋๋ก ๊ด๋ฆฌํ๊ณ ์์ต๋๋ค.
๊ทธ๋ฌ๋ ์กฐ๊ธ ๋ ์์ ํ๊ฒ ํ๊ธฐ ์ํด์๋ ๋๊ธ๋ง ์ด๋ฏธ์ง๋ฅผ ์ฃผ๊ธฐ์ ์ผ๋ก ์ ๋ฆฌํ๋ ๋ช
๋ น์ด๋ฅผ ๋ฐฐํฌ ์คํฌ๋ฆฝํธ์ ์ถ๊ฐํด๋ ์ข์ ๊ฒ ๊ฐ๋ค์, ์ฐธ๊ณ ํ๊ฒ ์ต๋๋ค~
๋ต ๋ต๋ณ ์๋ฃํ๊ณ Approve ๋ฐ์์ผ๋ merge ์งํํ๋๋ก ํ๊ฒ ์ต๋๋ค. |
๐ ๊ด๋ จ Issue ๋ฒํธ
๐ ์์ ๋ด์ฉ ์์ฝ
๐๐ป ์ฃผ์ ๊น๊ฒ ํ์ธํด์ผ ํ๋ ์ฝ๋
๐ ๊ฐ์ ์ฌํญ OR ์ฐธ๊ณ ์ฌํญ
ํ์ฌ main์๋ ์๋ฒ ๋ก์ง์ด ์๊ธฐ ๋๋ฌธ์ PR์ด ์งํ๋๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
์ฐธ๊ณ ํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!